Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: src/views/unix/SkOSWindow_Unix.cpp

Issue 16337012: Smallest possible desktop application that uses Skia to render stuff. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix OSX build. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gyp/SkiaExamples.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 image.depth = 24; 367 image.depth = 24;
368 image.bytes_per_line = bitmap.rowBytes() - bitmap.width() * 4; 368 image.bytes_per_line = bitmap.rowBytes() - bitmap.width() * 4;
369 image.bits_per_pixel = bitsPerPixel; 369 image.bits_per_pixel = bitsPerPixel;
370 return XInitImage(&image); 370 return XInitImage(&image);
371 } 371 }
372 372
373 void SkOSWindow::doPaint() { 373 void SkOSWindow::doPaint() {
374 if (NULL == fUnixWindow.fDisplay) { 374 if (NULL == fUnixWindow.fDisplay) {
375 return; 375 return;
376 } 376 }
377 // If we are drawing with GL, we don't need XPutImage.
378 if (NULL != fUnixWindow.fGLContext) {
379 return;
380 }
377 // Draw the bitmap to the screen. 381 // Draw the bitmap to the screen.
378 const SkBitmap& bitmap = getBitmap(); 382 const SkBitmap& bitmap = getBitmap();
379 int width = bitmap.width(); 383 int width = bitmap.width();
380 int height = bitmap.height(); 384 int height = bitmap.height();
381 385
382 XImage image; 386 XImage image;
383 if (!convertBitmapToXImage(image, bitmap)) { 387 if (!convertBitmapToXImage(image, bitmap)) {
384 return; 388 return;
385 } 389 }
386 390
(...skipping 10 matching lines...) Expand all
397 401
398 void SkEvent::SignalNonEmptyQueue() { 402 void SkEvent::SignalNonEmptyQueue() {
399 // nothing to do, since we spin on our event-queue, polling for XPending 403 // nothing to do, since we spin on our event-queue, polling for XPending
400 } 404 }
401 405
402 void SkEvent::SignalQueueTimer(SkMSec delay) { 406 void SkEvent::SignalQueueTimer(SkMSec delay) {
403 // just need to record the delay time. We handle waking up for it in 407 // just need to record the delay time. We handle waking up for it in
404 // MyXNextEventWithDelay() 408 // MyXNextEventWithDelay()
405 gTimerDelay = delay; 409 gTimerDelay = delay;
406 } 410 }
OLDNEW
« no previous file with comments | « gyp/SkiaExamples.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698