flutter_flutter/sky/engine/bindings/exception_state.cc
Eric Seidel a09baca0dd Add C++ based support for drawAtlas
This is supposed to make Viktor's game faster, but it's not clear
to me that it actually does.  I've left the code
using the dart version of drawAtlas for now until Viktor can
verify that it looks correct.

I also added a wrapper for SkFilterQuality in the process of
debugging SkCanvas.drawAtlas since all drawAtlas examples
in Skia use FilterQuality.low.  The bug which blocked me for
so long turned out to be that SkCanvas.drawAtlas doesn't
draw anything if antialiasing is turned on.

Issue #138.

R=abarth@google.com
2015-07-23 09:25:10 -07:00

58 lines
1.6 KiB
C++

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/engine/bindings/exception_state.h"
namespace blink {
ExceptionState::ExceptionState() : code_(0), had_exception_(false) {
}
ExceptionState::ExceptionState(Context context,
const char* propertyName,
const char* interfaceName) {
}
ExceptionState::ExceptionState(Context context, const char* interfaceName) {
}
ExceptionState::~ExceptionState() {
}
// TODO(iansf): Implement exceptions.
void ExceptionState::ThrowDOMException(const ExceptionCode&,
const String& message) {
had_exception_ = true;
}
void ExceptionState::ThrowTypeError(const String& message) {
had_exception_ = true;
}
void ExceptionState::ThrowRangeError(const String& message) {
had_exception_ = true;
}
bool ExceptionState::ThrowIfNeeded() {
return had_exception_;
}
void ExceptionState::ClearException() {
had_exception_ = false;
}
Dart_Handle ExceptionState::GetDartException(Dart_NativeArguments args,
bool auto_scope) {
// TODO(abarth): Still don't understand autoscope.
DCHECK(auto_scope);
// TODO(eseidel): This should be a real exception object!
if (!message_.isEmpty()) {
CString utf8 = message_.utf8();
return Dart_NewStringFromUTF8(reinterpret_cast<const unsigned char*>(utf8.data()), utf8.length());
}
return Dart_NewStringFromCString("Exception support missing. See exception_state.cc");
}
} // namespace blink